fix: invoke cli by program name in generated completion scripts#139
Conversation
🦋 Changeset detectedLatest commit: ed81535 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
dreyfus92
left a comment
There was a problem hiding this comment.
hey @AmirSa12 everything looks sound, i left a tiny nit and also we should consider that this silently changes the dev workflow source <(pnpm tsx cli.ts completezsh) used to work without installing, now the bin needs to be on PATH. fine tradeoff, but worth a line in the changeset or readme so people don't get bitten by it.
The concern about When you define This works across all supported shells (zsh, bash, fish, powershell) since I suggest adding the following dev workflow section to the docs:
|
Co-authored-by: Roman <dev@rman.dev>
|
Thank you all! |
closes #135
The adapters baked a reconstructed launch path (
process.execPath+execArgv+argv[1]) into the generated completion scripts, which assumes anode/bun script.jsinvocation. That path is invalid for compiled single-file binaries (bun build --compile, Node SEA, etc.), whereargv[1]is a virtual/duplicated path and this silently breaking tab completion. the commander, cac, and citty adapters now invoke the CLI by its program name, which the shell already resolves via PATH/alias/function.